﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExerciceV1_1
{
    public class Voyage
    {
        private static int id = 1;
        public DateTime DateVoyage { get; private set; }
        public int Numero { get; private set; }

        public string VilleDepart { get;  private set; }
        public string VilleArrive { get; private set; }

        public Bus VBus { get; private set; }
        public Chauffeur VChauffeur { get; private set; }

        public double Prix { get; private set; }
        public int NomberVoyageurs { get; private set; }

        public Voyage() 
        {
            DateVoyage = DateTime.Now;
            Numero = id;
            id++;
        }

        public Voyage(Bus bus, Chauffeur chauffeur, string villeDepart, string villeArrive, double prix, int nVoyageurs)
            : this()
        {
            this.VilleDepart = villeDepart;
            this.VilleArrive = villeArrive;
            this.VBus = bus;
            this.VChauffeur = chauffeur;
            this.Prix = prix;
            this.NomberVoyageurs = nVoyageurs;

        }

        public override string ToString()
        {
            string str = "Numero: " + this.Numero + "\tDate: " + this.DateVoyage + "\tNom du chauffeur: " + this.VChauffeur.Name;

            str += "\tPrenom du chauffeur: " + this.VChauffeur.Prenom + "\tImmatriculation du bus: " + this.VBus.Immatrucalution;
            str += "\tMarque de bus: " + this.VBus + "\tVille de depart: " + this.VilleDepart + "\tVille d'arrive: " + this.VilleArrive;
            str += "\tRecette:" + (this.Prix * NomberVoyageurs).ToString();

            return str;
        }


    }
}
